package com.lxy.controller;

import com.lxy.pojo.User;
import com.lxy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/to/{id}")
    @ResponseBody
    public User to(@PathVariable("id") String id){
        User use = userService.userByID(id);
        return use;
    }
}
